<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user', function (Blueprint $table) {
            $table->id();
            $table->char('openid',100)->comment('小程序openid');
            $table->char('official_openid',100)->comment('公众号openid');
            $table->char('unionid',100)->comment('开放平台unionid');
            $table->string('nickname',100)->comment('微信昵称');
            $table->char('avatar_url',150)->comment('微信头像');
            $table->unsignedTinyInteger('gender')->comment('性别：0-未知，1-男，2-女');
            $table->string('city',100)->comment('城市');
            $table->string('province',100)->comment('省');
            $table->string('country',100)->comment('国家');
//            $table->unsignedTinyInteger('identity')->comment('身份');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user');
    }
}
